KAFKA-20453: Add nodeId and listenerType tags to SocketServer metrics#22074
Closed
ChoMinGi wants to merge 1 commit into
Closed
KAFKA-20453: Add nodeId and listenerType tags to SocketServer metrics#22074ChoMinGi wants to merge 1 commit into
ChoMinGi wants to merge 1 commit into
Conversation
Add nodeId and listenerType tags to the four SocketServer gauge metrics (NetworkProcessorAvgIdlePercent, MemoryPoolAvailable, MemoryPoolUsed, ExpiredConnectionsKilledCount) so that each SocketServer instance registers uniquely-named metrics in the singleton Yammer registry. - Add metric cleanup in SocketServer.shutdown() - Replace reflection-based test with metric-based lookup in SocketServerMemoryPoolTest - Add unit tests verifying metric tags and shutdown cleanup - Update monitoring documentation with new MBean name format https://issues.apache.org/jira/browse/KAFKA-20453
Contributor
Author
|
Closing — this adds tags to Yammer MBean names which is a breaking change for monitoring setups. KIP-1207 solved the same root cause (Combined KRaft metric collision) for RequestHandlerAvgIdlePercent by adding separate Broker/Controller-prefixed metrics without touching existing MBean names. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
nodeIdandlistenerTypetags to the four SocketServer gauge metrics(NetworkProcessorAvgIdlePercent, MemoryPoolAvailable, MemoryPoolUsed, ExpiredConnectionsKilledCount) so that each SocketServer instance registers unique metrics in the singleton Yammer registry.In Combined KRaft mode, two SocketServer instances share the same JVM.
Without distinguishing tags,
newGauge()returns the existing gauge from the first instance, causing metrics to always reflect the controller's values.Also adds metric cleanup in
shutdown()and replaces the reflection-basedSocketServerMemoryPoolTestwith a metric-based lookup.Note that this changes JMX MBean names by appending the new tags.
I'm aware that KAFKA-19606 / KIP-1207 addressed a similar Combined KRaft metric issue for
RequestHandlerAvgIdlePercent.Please let me know if a KIP is needed for this change as well, or if an alternative approach (e.g. role-prefixed metric names) would be preferred.